import { Menu } from "@lgq/types";

export interface IAuthLoader {
  menuList: Menu.MenuItem[];
}

export default async function AuthLoader() {
  const menuList: Menu.MenuItem[] = [
    {
      id: 1,
      menuName: "Dashboard",
      icon: "", // 菜单图标
      menuType: 1,
      menuState: 1,
      menuCode: "dashboard",
      parentId: 0,
      path: "dashboard",
      children: [
        {
          id: 2,
          menuName: "工作台",
          icon: "", // 菜单图标
          menuType: 1,
          menuState: 1,
          menuCode: "workbench",
          parentId: 1,
          path: "workbench",
        },
        {
          id: 3,
          menuName: "分析",
          icon: "", // 菜单图标
          menuType: 1,
          menuState: 1,
          menuCode: "analysis",
          parentId: 1,
          path: "analysis",
          children: [
            {
              id: 30,
              menuName: "经营分析",
              icon: "", // 菜单图标
              menuType: 2,
              menuState: 2,
              menuCode: "operation",
              parentId: 1,
              path: "operation",
            },
          ],
        },
      ],
    },
    {
      id: 4,
      menuName: "系统管理",
      icon: "", // 菜单图标
      menuType: 1,
      menuState: 1,
      menuCode: "system",
      parentId: 0,
      path: "system",
      children: [
        {
          id: 5,
          menuName: "用户管理",
          icon: "", // 菜单图标
          menuType: 1,
          menuState: 1,
          menuCode: "user",
          parentId: 1,
          path: "user",
        },
        {
          id: 6,
          menuName: "角色管理",
          icon: "", // 菜单图标
          menuType: 1,
          menuState: 1,
          menuCode: "role",
          parentId: 1,
          path: "role",
        },
        {
          id: 7,
          menuName: "菜单管理",
          icon: "", // 菜单图标
          menuType: 1,
          menuState: 1,
          menuCode: "menu",
          parentId: 1,
          path: "menu",
        },
      ],
    },
    {
      id: 8,
      menuName: "个人中心",
      icon: "", // 菜单图标
      menuType: 1,
      menuState: 1,
      menuCode: "personal",
      parentId: 0,
      path: "personal",
      children: [
        {
          id: 9,
          menuName: "个人信息",
          icon: "", // 菜单图标
          menuType: 1,
          menuState: 1,
          menuCode: "info",
          parentId: 1,
          path: "info",
        },
        {
          id: 10,
          menuName: "个人设置",
          icon: "", // 菜单图标
          menuType: 1,
          menuState: 1,
          menuCode: "setting",
          parentId: 1,
          path: "setting",
        },
      ],
    },
  ];

  const data = {
    menuList: menuList,
  };
  console.log("AuthLoader");
  return {
    menuList: data.menuList,
  };
}
